import java.util.Properties;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2023-03-08
 * Time: 21:33
 */
@SuppressWarnings({"all"})
public class Properties_ {
    public static void main(String[] args) {

        //1.properties继承Hashtable
        //2.键值对存放数据 k-v都不能为空 抛出空指针异常
        Properties properties = new Properties();
        properties.put("john",100);
        properties.put("lucy",100);
        properties.put("lic",100);
        properties.put("lic",88); //相同的键 也是被替换 无序的

        System.out.println("properties=" + properties);
        //不一样的地方是
        //获取对应的值
        System.out.println(properties.get("lic"));//88

        //删除元素 remove
        properties.remove("lic");
        System.out.println("properties=" + properties);
        //修改 重新put一个相同的k
        properties.put("john","约翰");
        System.out.println("properties=" + properties);


    }
}
